package com.yykj.pay.server.util.Page;


import com.github.pagehelper.PageHelper;

/**
 * 分页工具类
 * 
 */
public class PageUtils
{
    /**
     * 设置请求分页数据
     */
    public static void startPage(Integer pageNum,Integer pageSize,String OrderBy,String orderType)
    {
        if (pageNum !=null && pageSize!=null)
        {
            if (OrderBy != null){
                if(orderType == null){
                    orderType = "DESC";
                }
                String orderBy = SqlUtil.escapeOrderBySql(OrderBy + " " + orderType);
                PageHelper.startPage(pageNum, pageSize,orderBy);
            }else {
                PageHelper.startPage(pageNum, pageSize);
            }

        }
    }
}
